import Cookies from 'js-cookie'

const TokenKey = 'token'

export default {
  removeToken() {
    return Cookies.remove(TokenKey)
  },
  setToken(token) {
    var inFifteenMinutes = new Date(new Date().getTime() +30 * 60* 1000);
    return Cookies.set(TokenKey, token,{
      expires: inFifteenMinutes,
      path:"/"
    })
  },
  getToken() {
    return Cookies.get(TokenKey)
  }
}
